﻿<?php


include("db_connection.php"); //db접속파일
global $connect;


//$userID = $_REQUEST['user'];

$sql = "SELECT * FROM communication;";

$rs = mysql_query($sql, $connect);

while($result = mysql_fetch_array($rs)){
  $id = $result[id];
  $text = $result[text];
  $to_time = $result[to_time];
  $to_id = $result[to_id];
      
$xmlList.="<chat><id>$id</id><text>$text</text><to_time>$to_time</to_time><to_id>to_id</to_id></chat>";

}
mysql_free_result($rs);

$xmlDoc="<?xml version='1.0' encoding='utf-8'?><root>$xmlList</root>";

 echo    $xmlDoc;


?>